﻿Jxstar.currentPage = function() {
	var config = {param:{},initpage:function(page, define){},eventcfg:{}};
	
	var authtypeData = Jxstar.findComboData('authtype');
	var auditData = Jxstar.findComboData('audit');
	var moneytypeData = Jxstar.findComboData('moneytype');
	var purtypeData = Jxstar.findComboData('purtype');
	var htstatusData = Jxstar.findComboData('htstatus');
	var httypeData = Jxstar.findComboData('httype');
	var items = [{
		width:'97%',
		border:false,
		layout:'form',
		autoHeight:true,
		xtype:'container',
		style:'padding:5 10 5 10;',
		items:[{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'trigger', fieldLabel:'谈判单号', name:'contract__say_code',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:20, editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'contract_say', layoutPage:'', sourceField:'contract_say.bid_money', targetField:'contract.contract_money', whereSql:"auditing='1'", whereValue:'', whereType:'', isSame:'1', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'contract.say_code'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_creat_form');
						}},
					{xtype:'trigger', fieldLabel:'项目编号', name:'contract__project_code',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:20, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'project_select', layoutPage:'', sourceField:'project_base.bid_money', targetField:'contract.contract_money', whereSql:"project_status = '2'  and projbao_type <>'2'", whereValue:'', whereType:'', isSame:'1', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'contract.project_code'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_creat_form');
						}},
					{xtype:'textfield', fieldLabel:'项目名称', name:'contract__project_name', readOnly:true, anchor:'100%', maxLength:100},
					{xtype:'textfield', fieldLabel:'实施单位', name:'contract__dept_name', readOnly:true, anchor:'100%', maxLength:50},
					{xtype:'combo', fieldLabel:'授权形式', name:'contract__auth_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: authtypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: authtypeData[0][0]},
					{xtype:'trigger', fieldLabel:'对方签约单位', name:'contract__provider_name',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:50, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'provider_select', layoutPage:'', sourceField:'provider.provider_name;provider_id', targetField:'contract.provider_name;provider_id', whereSql:"manage_status='20'", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'contract.provider_name'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_creat_form');
						}},
					{xtype:'textfield', fieldLabel:'合同名称', name:'contract__contract_name', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:100},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'合同金额(万元)', name:'contract__contract_money', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', anchor:'100%', maxLength:12},
					{xtype:'datefield', fieldLabel:'合同创建日期', name:'contract__creat_date', defaultval:'fun_getToday()', format:'Y-m-d', anchor:'100%'},
					{xtype:'fileuploadfield', fieldLabel:'上传合同文本', name:'contract__contract_file', allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', readOnly:true, anchor:'100%'},
					{xtype:'hidden', fieldLabel:'银行账号', name:'contract__bank_account', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'实施单位ID', name:'contract__dept_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'合同签订部门ID', name:'contract__done_deptid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目ID', name:'contract__project_id', anchor:'100%'}
				]
			},{
				border:false,
				xtype:'container',
				columnWidth:0.495,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'combo', fieldLabel:'记录状态', name:'contract__auditing', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: auditData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: auditData[0][0]},
					{xtype:'textfield', fieldLabel:'项目负责人', name:'contract__project_user', readOnly:true, anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'项目类别', name:'contract__money_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: moneytypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: moneytypeData[0][0]},
					{xtype:'numberfield', decimalPrecision:6, fieldLabel:'项目批复金额(万元)', name:'contract__project_money', readOnly:true, anchor:'100%', maxLength:12},
					{xtype:'combo', fieldLabel:'采购方式', name:'contract__pur_type',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: purtypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: purtypeData[0][0]},
					{xtype:'trigger', fieldLabel:'合同签订部门', name:'contract__done_deptname',
						anchor:'100%', triggerClass:'x-form-search-trigger',
						maxLength:50, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*', editable:false,
						onTriggerClick: function() {
							var selcfg = {pageType:'combogrid', nodeId:'sys_dept', layoutPage:'/public/layout/layout_tree.js', sourceField:'sys_dept.dept_name;dept_id', targetField:'contract.done_deptname;done_deptid', whereSql:"", whereValue:'', whereType:'', isSame:'0', isShowData:'1', isMoreSelect:'0',isReadonly:'1',queryField:'',likeType:'',fieldName:'contract.done_deptname'};
							JxSelect.createSelectWin(selcfg, this, 'node_contract_creat_form');
						}},
					{xtype:'textfield', fieldLabel:'合同编号', name:'contract__contract_code', anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'合同状态', name:'contract__contract_status', defaultval:'0',
						anchor:'100%', readOnly:true, editable:false,
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: htstatusData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: htstatusData[0][0]},
					{xtype:'textfield', fieldLabel:'合同编制人', name:'contract__create_user', defaultval:'fun_getUserName()', anchor:'100%', maxLength:20},
					{xtype:'combo', fieldLabel:'合同类型', name:'contract__contract_type', defaultval:'0',
						anchor:'100%', editable:false, allowBlank:false, labelStyle:'color:#0000FF;', labelSeparator:'*',
						store: new Ext.data.SimpleStore({
							fields:['value','text'],
							data: httypeData
						}),
						emptyText: jx.star.select,
						mode: 'local',
						triggerAction: 'all',
						valueField: 'value',
						displayField: 'text',
						value: httypeData[0][0]},
					{xtype:'hidden', fieldLabel:'开户银行', name:'contract__bank_name', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'供应商ID', name:'contract__provider_id', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'项目负责人ID', name:'contract__project_userid', anchor:'100%'},
					{xtype:'hidden', fieldLabel:'主键', name:'contract__contract_id', anchor:'100%'}
				]
			}
			]
		},{
			anchor:'100%',
			border:false,
			xtype:'container',
			layout:'column',
			autoHeight:true,
			items:[{
				border:false,
				xtype:'container',
				columnWidth:0.99,
				layout:'form',
				style: 'padding-left:10px;',
				items:[
					{xtype:'textarea', fieldLabel:'备注', name:'contract__memo', width:'100%', height:72, maxLength:200}
				]
			}
			]
		}]
	}];
	
	config.param = {
		items: items,
		funid: 'contract_creat'
	};

	
	
	
	return new Jxstar.FormNode(config);
}